Page({
  data: {
    time: '12:00',
    ids: "",
    week: ["一", "二", "三", "四", "五", "六", "日"],
    status: [false, false, false, false, false, false, false, ]
  },
  bindTimeChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      time: e.detail.value
    })
  },

  choose(e) {
    console.log(e.target.id);
    this.data.status[e.target.id] = !this.data.status[e.target.id]
    this.setData({
      status: this.data.status
    })
  },
  truer() {
    console.log(this.data.time.split(":"));
    let time=this.data.time.split(":")
    // let chuo=Number(time[0])*3600*1000+Number(time[1])*60*1000
    let data = new Date()
    console.log(data);
    let tim=`${data.getFullYear()}-${data.getMonth()+1}-${data.getDate()} ${time[0]}:${time[1]}`
    let chuo= new Date(tim).getTime()
    console.log(chuo);



    console.log(this.data.status);
    let arr = []
    this.data.status.forEach((item, index) => {
      if (item) {
        arr.push(index + 1)
      }
    })

    let obj = {
      publishTime: chuo,
      reduplicate: arr
    }

    wx.setStorageSync('week', obj)

    wx.redirectTo({
      url: '../zguye/zhuye',
    })
  }

})